import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

//引入 element plus 插件
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

//引入 vue-router 插件
import router from './router';
//引入pinia 插件
import { createPinia } from 'pinia';
//引入pinia持久化 插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

//引入所有element icon
import * as ElementPlusIconsVue from '@element-plus/icons-vue'   //引入全部icon
import WebSocketPlugin from './WebSocket'
  


const url:string = "wss://localhost:5001/ws"
const app = createApp(App)
const pinia = createPinia()

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)   //动态注册
  }

app.use(pinia)
app.use(ElementPlus)
app.use(router);
app.use(WebSocketPlugin,{url})

pinia.use(piniaPluginPersistedstate)


app.mount('#app')
